<template style="height:100vh;overflow: hidden;">
	<view>
		<view class="bg" />
		<view class="content">
			<div class="verification-container">
				<view style="text-align: center;font-size: 18px;height: 40px;">
					核销码 {{orderObject.verificationCode}}
				</view>
				<view style="height: 4px;background-color: #e3e3e366;"></view>
				<p style="font-size: 18px;margin: 18px 0;">服务内容</p>
				<div class="service-content">
					<p>XXX标准洗车服务包含</p>
					<p>整车泡沫冲洗擦T</p>
					<p>轮胎轮毂冲洗清洁</p>
					<p>车内吸尘</p>
					<p>内饰脚垫简单除尘</p>
					<p>(不包含虫户、水泥、沥青和顽固污渍清理等)</p>
				</div>
				<view style="height: 4px;background-color: #e3e3e366;"></view>
				<div class="order-info">
					<p style="font-size: 18px;margin: 18px 0;">订单信息</p>
					<p>订单价格: ¥ {{orderObject.totalPrice}}</p>
					<p>实付金额: ¥ {{orderObject.realPrice}}</p>
					<p>优惠金额: ¥ {{formatPrice(orderObject.totalPrice - orderObject.realPrice)}}</p>
					<p>订单编号 {{orderObject.number}}</p>
					<p>支付时间 {{orderObject.verificationTime}}</p>
					<p>预约时间 {{orderObject.subscribeTime}}</p>
				</div>
			</div>
		</view>
		<button type="primary" style="width: 600rpx;border-radius: 20px;margin-top: -120px;"
			@click="showId">确认核销</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderId: '',
				orderObject: {},
			}
		},
		methods: {
			getInfo(id) {
				let that = this
				this.$http({
					url: '/api/order/order/' + id,
					method: 'get',
					success(res) {
						if (res.data.code == 200) {
							that.orderObject = res.data.data
							console.log(that.orderObject)
						} else {
							console.log("sad")
						}
					}
				})
			},
			formatPrice(price) {
				return parseFloat(price).toFixed(2);
			}
		},
		onLoad() {
			this.orderId = this.$route.query.id;
			this.getInfo(this.$route.query.id)
		}
	}
</script>

<style lang="scss" scoped>
	.bg {
		width: 100%;
		background-color: #3183FB;
		height: 172px;
	}

	.content {
		position: relative;
		top: -152px;
		left: 22.5rpx;
		border-radius: 20px;
		width: 94%;
		background-color: white;
		padding: 28px 16px;
		box-sizing: border-box;
	}

	p {
		margin: 12px 0;
	}
</style>